package com.community.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.community.dao.IBaseDao;
import com.community.entity.Course;
import com.community.entity.CourseEnroll;
import com.community.service.ICourseService;

@Service
public class CourseServiceImpl implements ICourseService{
	@Autowired
	private IBaseDao<Course> cdao;


	
	@Override
	public List<Course> getCourseList(int isEnd) {
		// TODO Auto-generated method stub
		String jpql = "from Course where isEnd = ?1";
		Map<String, Object> params = new HashMap<>();
		params.put("1", isEnd);
		return cdao.find(jpql, params);
	}

	@Override
	public Course getCourseById(Long id) {
		// TODO Auto-generated method stub
		return cdao.get(Course.class, id);
	}



}
